/*
 * @Author: viivLgr
 * @Date: 2018-06-07 17:11:06
 * @Last Modified by: viivLgr
 * @Last Modified time: 2018-06-07 18:37:21
 */

import Util from 'util/util.jsx';

const _util = new Util();

class Order {
    // 订单列表
    getOrderList(listParam) {
        let url = '',
            data = {};
        if(listParam.listType === 'list'){
            url = '/manage/order/list.do';
            data.pageNum = listParam.pageNum;
        }else if(listParam.listType === 'search'){
            url = '/manage/order/search.do';
            data.pageNum = listParam.pageNum;
            data.orderNo = listParam.orderNo;
        }
        return _util.request({
            type: 'POST',
            url: url,
            data: data
        });
    }
    // 获取订单详情
    getOrder(orderNo){
        return _util.request({
            type: 'POST',
            url: '/manage/order/detail.do',
            data: {
                orderNo: orderNo
            }
        });
    }
    // 发货
    sendGoods(orderNo){
        return _util.request({
            type: 'POST',
            url: '/manage/order/send_goods.do',
            data: {
                orderNo: orderNo
            }
        });
    }
}

export default Order;